
package org.come.Jpanel;

import com.tool.btn.LingBaoZhiYuanBtn;
import com.tool.btn.LingbaoPagingBtn;
import com.tool.role.RoleLingFa;
import com.updateNew.MyIsif;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.LayoutManager;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.come.mouslisten.LingFaFanYeMouslisten;
import com.tool.tcpimg.UIUtils;



public class LingbaoEquipmentJpanel extends JPanel {
    private JLabel labLingbao;
    private JLabel labMagicOne;
    private JLabel labMagicTwo;
    private LingbaoPagingBtn btnLast1;
    private LingbaoPagingBtn btnNext1;
    private LingbaoPagingBtn btnLast2;
    private LingbaoPagingBtn btnNext2;
    private JLabel[] LingbaoListLabel = new JLabel[8];
    private JLabel[] MagicListLabel = new JLabel[8];
    private int Flag = 0;
    private int count = 1;
    private ImageIcon icon;
    private LingBaoZhiYuanBtn lingBaoZhiYuanBtn;

    public LingbaoEquipmentJpanel() {
        if ("水墨UI".equals(MyIsif.getStyle())) {
            this.setPreferredSize(new Dimension(538, 469));
            this.setLayout((LayoutManager) null);
            this.setBackground(UIUtils.Color_BACK);
            this.labLingbao = new JLabel();
            this.labLingbao.setBounds(265, 115, 40, 40);
            this.labLingbao.addMouseListener(new LingFaFanYeMouslisten(true, -1));
            this.add(this.labLingbao);
            this.labMagicOne = new JLabel();
            this.labMagicOne.setBounds(215, 175, 37, 36);
            this.labMagicOne.addMouseListener(new LingFaFanYeMouslisten(false, -1));
            this.add(this.labMagicOne);
            this.labMagicTwo = new JLabel();
            this.labMagicTwo.setBounds(323, 175, 37, 36);
            this.labMagicTwo.addMouseListener(new LingFaFanYeMouslisten(false, -2));
            this.add(this.labMagicTwo);
            lingBaoZhiYuanBtn = new LingBaoZhiYuanBtn("inkImg/button/49.png", 1, "支援列表");
            lingBaoZhiYuanBtn.setBounds(70, 435, 68, 17);
            this.add(lingBaoZhiYuanBtn);
        } else {
            this.setPreferredSize(new Dimension(512, 496));
            this.setLayout((LayoutManager) null);
            this.setBackground(Color.BLACK);
            this.labLingbao = new JLabel();
            this.labLingbao.setBounds(240, 130, 40, 40);
            this.labLingbao.addMouseListener(new LingFaFanYeMouslisten(true, -1));
            this.add(this.labLingbao);
            this.labMagicOne = new JLabel();
            this.labMagicOne.setBounds(193, 187, 37, 36);
            this.labMagicOne.addMouseListener(new LingFaFanYeMouslisten(false, -1));
            this.add(this.labMagicOne);
            this.labMagicTwo = new JLabel();
            this.labMagicTwo.setBounds(298, 187, 37, 36);
            this.labMagicTwo.addMouseListener(new LingFaFanYeMouslisten(false, -2));
            this.add(this.labMagicTwo);
            lingBaoZhiYuanBtn = new LingBaoZhiYuanBtn("inkImg/hongmu/a7.png", 1, "支援列表");
            lingBaoZhiYuanBtn.setBounds(45, 450, 100, 17);
            this.add(lingBaoZhiYuanBtn);
        }
        if ("水墨UI".equals(MyIsif.getStyle())) {
            this.btnLast1 = new LingbaoPagingBtn("skin/8100226/button/10.png", 1, 0, (String) null);
            this.btnLast1.setBounds(215, 435, 19, 20);
            this.add(this.btnLast1);
            this.btnNext1 = new LingbaoPagingBtn("skin/8100226/button/9.png", 1, 1, (String) null);
            this.btnNext1.setBounds(235, 435, 19, 20);
            this.add(this.btnNext1);
            this.btnLast2 = new LingbaoPagingBtn("skin/8100226/button/10.png", 1, 2, (String) null);
            this.btnLast2.setBounds(447, 435, 19, 20);
            this.add(this.btnLast2);
            this.btnNext2 = new LingbaoPagingBtn("skin/8100226/button/9.png", 1, 3, (String) null);
            this.btnNext2.setBounds(467, 435, 19, 20);
            this.add(this.btnNext2);
            int i;
            for (i = 0; i < 8; ++i) {
                this.LingbaoListLabel[i] = new JLabel();
                this.MagicListLabel[i] = new JLabel();
                if (this.Flag < 4 && this.count == 1) {
                    this.LingbaoListLabel[i].setBounds(75 + this.Flag * 51, 333, 48, 48);
                    this.LingbaoListLabel[i].addMouseListener(new LingFaFanYeMouslisten(true, i));
                    this.MagicListLabel[i].setBounds(306 + this.Flag * 51, 333, 48, 48);
                    this.MagicListLabel[i].addMouseListener(new LingFaFanYeMouslisten(false, i));
                    ++this.Flag;
                    this.add(this.LingbaoListLabel[i]);
                    this.add(this.MagicListLabel[i]);
                }

                if (this.Flag < 4 && this.count == 2) {
                    this.LingbaoListLabel[i].setBounds(75 + this.Flag * 51, 381, 48, 48);
                    this.LingbaoListLabel[i].addMouseListener(new LingFaFanYeMouslisten(true, i));
                    this.MagicListLabel[i].setBounds(306 + this.Flag * 51, 381, 48, 48);
                    this.MagicListLabel[i].addMouseListener(new LingFaFanYeMouslisten(false, i));
                    ++this.Flag;
                    this.add(this.LingbaoListLabel[i]);
                    this.add(this.MagicListLabel[i]);
                } else if (this.Flag == 4) {
                    this.Flag = 0;
                    ++this.count;
                }
            }
        } else {
            this.btnLast1 = new LingbaoPagingBtn("inkImg/hongmu/2/29_png.button.btn_8.png", 1, 0, (String) null);
            this.btnLast1.setBounds(215, 450, 19, 20);
            this.add(this.btnLast1);
            this.btnNext1 = new LingbaoPagingBtn("inkImg/hongmu/2/36_png.button.btn_7.png", 1, 1, (String) null);
            this.btnNext1.setBounds(235, 450, 19, 20);
            this.add(this.btnNext1);
            this.btnLast2 = new LingbaoPagingBtn("inkImg/hongmu/2/29_png.button.btn_8.png", 1, 2, (String) null);
            this.btnLast2.setBounds(447, 450, 19, 20);
            this.add(this.btnLast2);
            this.btnNext2 = new LingbaoPagingBtn("inkImg/hongmu/2/36_png.button.btn_7.png", 1, 3, (String) null);
            this.btnNext2.setBounds(467, 450, 19, 20);
            this.add(this.btnNext2);
            for (int i = 0; i < 8; ++i) {
                this.LingbaoListLabel[i] = new JLabel();
                this.MagicListLabel[i] = new JLabel();
                if (this.Flag < 4 && this.count == 1) {
                    this.LingbaoListLabel[i].setBounds(48 + this.Flag * 51, 346, 48, 48);
                    this.LingbaoListLabel[i].addMouseListener(new LingFaFanYeMouslisten(true, i));
                    this.MagicListLabel[i].setBounds(282 + this.Flag * 51, 346, 48, 48);
                    this.MagicListLabel[i].addMouseListener(new LingFaFanYeMouslisten(false, i));
                    ++this.Flag;
                    this.add(this.LingbaoListLabel[i]);
                    this.add(this.MagicListLabel[i]);
                }

                if (this.Flag < 4 && this.count == 2) {
                    this.LingbaoListLabel[i].setBounds(48 + this.Flag * 51, 397, 48, 48);
                    this.LingbaoListLabel[i].addMouseListener(new LingFaFanYeMouslisten(true, i));
                    this.MagicListLabel[i].setBounds(282 + this.Flag * 51, 397, 48, 48);
                    this.MagicListLabel[i].addMouseListener(new LingFaFanYeMouslisten(false, i));
                    ++this.Flag;
                    this.add(this.LingbaoListLabel[i]);
                    this.add(this.MagicListLabel[i]);
                } else if (this.Flag == 4) {
                    this.Flag = 0;
                    ++this.count;
                }
            }
        }
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if ("水墨UI".equals(MyIsif.getStyle())) {
            if (this.icon == null) {
                this.icon = new ImageIcon("inkImg/newbackground/B237.png");
            }

            g.drawImage(this.icon.getImage(), 0, 0, 538, 469, this);
            RoleLingFa.getRoleLingFa().drawL(g, 75, 333);
            RoleLingFa.getRoleLingFa().drawF(g, 306, 333);
        } else {
            if (this.icon == null) {
                this.icon = new ImageIcon("inkImg/hongmu/2/灵宝穿戴.png");
            }

            g.drawImage(this.icon.getImage(), 0, 0, 512, 496, this);
            RoleLingFa.getRoleLingFa().drawL(g, 48, 346);
            RoleLingFa.getRoleLingFa().drawF(g, 282, 346);
        }

    }

    public JLabel getLabLingbao() {
        return this.labLingbao;
    }

    public void setLabLingbao(JLabel labLingbao) {
        this.labLingbao = labLingbao;
    }

    public JLabel getLabMagicOne() {
        return this.labMagicOne;
    }

    public void setLabMagicOne(JLabel labMagicOne) {
        this.labMagicOne = labMagicOne;
    }

    public JLabel getLabMagicTwo() {
        return this.labMagicTwo;
    }

    public void setLabMagicTwo(JLabel labMagicTwo) {
        this.labMagicTwo = labMagicTwo;
    }

    public JLabel[] getLingbaoListLabel() {
        return this.LingbaoListLabel;
    }

    public void setLingbaoListLabel(JLabel[] lingbaoListLabel) {
        this.LingbaoListLabel = lingbaoListLabel;
    }

    public JLabel[] getMagicListLabel() {
        return this.MagicListLabel;
    }

    public void setMagicListLabel(JLabel[] magicListLabel) {
        this.MagicListLabel = magicListLabel;
    }
}
